//
//  XBSegmentedControl.h
//  FamilyDoctor
//
//  Created by xxb on 2017/11/15.
//  Copyright © 2017年 zoenet. All rights reserved.
//

#import <UIKit/UIKit.h>

@protocol XBSegmentedControlDelegate <NSObject>

-(void)didSelectAtIndex:(NSInteger)index;

@end

@interface XBSegmentedControl : UIView

@property (nonatomic, strong) NSArray *dataSource; //数据集
@property (nonatomic, assign) NSInteger selectedRow;//选中的行

//自定义部分
@property (nonatomic, assign) BOOL showLineView;//底部横线是否要展示
@property (nonatomic, assign) BOOL noBlodWhenSelected;//是否粗体
@property (nonatomic, assign) BOOL centerWhenNotEnoughData;//当数据不够时，是否要让分段居中
@property (nonatomic, strong) UIColor *textColorSelected;//文本选中的颜色

@property (nonatomic, weak) id<XBSegmentedControlDelegate> delegate;

-(void)reloadData;

/**
 动画滚动到选中的tab，这个方法主要是用于处理collectionView的contentOffset
 
 @param index index description
 */
-(void)setSelectedSegmentIndex:(NSInteger)index;

@end
